typeBug is package {
  import task;
  import cml;

  serve(ch) is task {
    valis valof
      (case await(recv(ch)) in {
        true is task { valis valof serve(ch); }
        false is task { valis (); }
        _ default is task { raise "invalid state"; }
      })
  }

  main() do {
    ch is channel();
    _ is valof backgroundF(serve(ch));
    assert (valof send(ch, true)) = ();
    assert (valof send(ch, false)) = ();
  }

};